/**
 * 页面初始化后执行JS
 **/
Ext.onReady(function(){
	
	Ext.QuickTips.init();
	
	var gridStructure = [{  
		name: 'convertId',
		hidden: true
	},{
		name: 'convertName',  
		header: '转换策略名称',
		editor: new Ext.form.TextField({
			allowBlank: false,
			maxLength: 25
		})
	},{  
		name: 'inServerIp',  
		header: '内网服务器IP',
		editor: new Ext.form.TextField({
			maxLength: 50
		})
	},{  
		name: 'inServerPort',  
		header: '内网服务器端口',
		editor: new Ext.form.TextField({
			maxLength: 5
		})
	},{  
		name: 'outServerIp',  
		header: '外网服务器IP',
		editor: new Ext.form.TextField({
			maxLength: 50
		})
	},{
		name: 'outServerPort',  
		header: '外网服务器端口',
		editor: new Ext.form.TextField({
			maxLength: 5
		})
	},{
		type: 'boolean',
		name: 'isActive',  
		header: '是否启用',
		editor: new Ext.ux.TwoItemComboBox({
            itemType: 'boolean',
            allowBlank: false
		})
	},{  
		name: 'remark',  
		header: '备注',
		editor: new Ext.form.TextField({
			maxLength: 100
		})
	}];
   
	var grid = new Ext.ux.grid.RowEditorGrid({
		structure: gridStructure,
		readUrl: 'at-server-convert!list.action',
		createUrl: 'at-server-convert!create.action',
		updateUrl: 'at-server-convert!update.action',
		destroyUrl: 'at-server-convert!delete.action',
		defaultSortField: 'isActive',  
		idField: 'convertId',
		title: 'Web服务器外网地址转换列表',
		region: 'center',
		margins: '1 1 1 1'
	});

	var viewPort = new Ext.Viewport({
		layout: 'border',		
		items: [grid]
	});
});